package com.lhd.action.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: liuhd
 * @Date: 2024/12/19 13:22
 * @Description: 具体迭代器
 */
public class ConcreteBookIterator extends BookIterator {
    public ConcreteBookIterator(List<Book> bookList) {
        super(bookList);
    }

    @Override
    public Book next() {
        return bookList.get(index ++);
    }

    @Override
    public boolean hasNext() {
        return index < bookList.size();
    }
}
